package com.wanbangee.marksystem.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.websocket.server.PathParam;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.wanbangee.marksystem.entities.UTeacher;
import com.wanbangee.marksystem.service.ProgressCheckService;

@RestController
@RequestMapping("progress") 
public class ProgressCheckController {

	@Autowired
	private ProgressCheckService progressCheckService;
	
	/**
	 * 添加阅卷人查询--用于进度管理
	 * @param schId
	 * @param subId 
	 * @param teaNm
	 * @return
	 */
	@GetMapping("/user/selectUTeacherBySchIdAndSubIdAndTeaNmLike")
	public Map<String, Object> selectUTeacherBySchIdAndSubIdAndStuNmLike(@RequestParam(value="schId",required = false)Integer schId,@RequestParam(value = "subId",required = false)Integer subId,@RequestParam(value = "teaNm",required = false)String teaNm){
		List<UTeacher> uTeachers = progressCheckService.selectUTeacherBySchIdAndSubIdAndStuNmLike(schId, subId, teaNm);
		HashMap<String, Object> map = new HashMap<String, Object>();
		if(uTeachers==null || uTeachers.size()==0) {
			map.put("code", 10013);
			map.put("result", null);
		}else {
			map.put("code", 1001);
			map.put("result", uTeachers);
		}
		return map;
	}
}
